//
// Created by JYL on 2024-06-21.
//

#ifndef WHEELTEC_BEEP_H
#define WHEELTEC_BEEP_H

#include "main.h"

#define Buzzer(x)   do{ x ? \
                      HAL_GPIO_WritePin(Buzzer_GPIO_Port, Buzzer_Pin, GPIO_PIN_SET) : \
                      HAL_GPIO_WritePin(Buzzer_GPIO_Port, Buzzer_Pin, GPIO_PIN_RESET); \
                  }while(0)
#define BEEP_TOGGLE()  HAL_GPIO_TogglePin(Buzzer_GPIO_Port,Buzzer_Pin)

typedef struct
{
    bool isActive;
    bool isLoop;
    u16 waitMS;
}beepSeq_t;

enum beepAction
{
    BEEP_UART = 0,
    BEEP_TURN,
    BEEP_WAIT,
    BEEP_LOOP,
};


//void beepInit(void);
void runBeepAcktion(enum beepAction runaction);
void stopBeepAcktion(enum beepAction runaction);

#endif //WHEELTEC_BEEP_H
